#include <stdio.h>

#define BUFFER_SIZE 10

int main()
{
    int array[BUFFER_SIZE];
    memset(array, 0, sizeof(array));

    /*数组的赋值*/
    for(int idx = 0; idx < BUFFER_SIZE; idx++)
    {
        array[idx] = idx + 1;
    }

    /*数组打印*/
    for(int idx = 0; idx < BUFFER_SIZE; idx++)
    {
        printf("array[%d] = %d\n", idx, array[idx]);
    }

    /*原数组：1 2 3 4 5 6 7 8 9 10*/
    /*数组逆序*/
    /*10 9 8 7 6 5 4 3 2 1*/
    int temp = 0;
    for(int idx = 0; idx < BUFFER_SIZE / 2; idx++)
    {
        temp = array[idx];
        array[idx] = array[BUFFER_SIZE - 1 - idx];
        array[BUFFER_SIZE - 1 - idx] = temp;
        
    }
    for(int idx = 0; idx < BUFFER_SIZE; idx++)
    {
        printf("array[%d] = %d\n", idx, array[idx]);
    }

    return 0;
}